<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<link rel="stylesheet" type="text/css" href="../../css/style.css" />
		<style type="text/css">
			html,body{
				height:100%;
				background-color: transparent !important;
				overflow-x: auto;
				-webkit-overflow-scrolling:touch;
				animation:fadein 0.3s linear 1;
				-webkit-animation:fadein 0.3s linear 1;
				-moz-animation:fadein 0.3s linear 1;
				-o-animation:fadein 0.3s linear 1;
				-ms-animation:fadein 0.3s linear 1;
			}
			.s_type{ height: 45px; background-color: #fff;}
			.s_type a{ float: left; width: 33.33%; text-align: center; font-size: 13px; color: #666;}
			.s_type a i{ display:inline-block; vertical-align: top; height: 45px; line-height: 45px; padding-right: 15px; background-position: center right; background-repeat: no-repeat; background-size: 10px auto; background-image: url(../../image/img_44.png);}
			.s_type a:last-child i{ background-image:url(../../image/img_45.png); background-size: 11px auto;}
			.s_type a img{ display:inline-block; vertical-align: top; width: 16px; margin-top: 14px; margin-right: 5px;}
			.s_type a.on{ color:#1c63fa; background-color: transparent;}
			.s_type a.on i{ background-image:url(../../image/img_44a.png);}
			.s_type a:last-child.on i{ background-image:url(../../image/img_45a.png);}
			
			.Area{ width: 100%; overflow:hidden; background: #fff; height: 285px;}
			.Area .block{ height: 100%; box-sizing: border-box; -webkit-box-sizing: border-box; -moz-box-sizing:border-box; overflow-y: auto;}
			.AreaLeft{ width: 34%; float: left; }
			.AreaLeft ul li{ width: 100%; padding: 10px 0; line-height: 25px; text-align:center; color:#333; font-size:14px;}
			.AreaLeft ul li:active{ background-color: #f8f8f8; }
			.Area ul li.on{ color:#3262F1; }
			.leftarea{ color:#3262F1;}
			.on{ color:#3262F1;}
			.AreaCenter{ width: 33%; float: left;  }
			.AreaCenter ul li{ padding: 10px 0;  line-height: 25px; text-align:center; font-size:14px;}
			.AreaRight{ width: 33%; float: left;  }
			.AreaRight ul li{ width: 100%;  padding: 10px 0; line-height: 25px; text-align:center; font-size:14px;}
			
			.Area b {
				background: #f1f3f4;
				display: block;
				font-size: 12px;
				color: #999;
				line-height: 40px;
				font-weight: 400;
				text-align: center;
			}
			.case_box{ overflow-y: auto; z-index: 10;}
			.case_box div{ background-color: #fff;  }
			.case_box b{ display: block; padding:0 15px; font-size: 12px; font-weight: 400; color: #999; line-height: 30px;}
			.case_box .check {padding:0 15px;}
			.case_box .check li,.add_type li{ float:left; width: 33.33%; text-align: center; font-size: 13px; color: #333; line-height: 35px;}
			
			.case_box .check li:nth-child(3n+1){ text-align:left;}
			.case_box .check li:nth-child(3n){ text-align:right;}
			.case_box .check01 li{ width: 23%;}
			.case_box .check01 li:last-child{ text-align:right;}
			.case_box .check01 li:nth-child(3n){ text-align: center; }
			.case_box .check span,.add_type li span{ display:inline-block; vertical-align: top; height: 35px; padding-left: 20px; background: url(../../image/img_24.png) no-repeat left center; background-size: 15px auto;}
			.case_box .check span.on,.add_type li span.on{ background-image:url(../../image/img_25.png);}
			.case_box .check02{ padding:0 15px;}
			.case_box .check02 li,.add_long li{ float:left; width: 23.5%; margin-right: 2%;margin-bottom: 8px; text-align: center; font-size: 13px; color: #333; line-height: 28px; background-color: #f6f6f6; border-radius: 3px;}
			.case_box .check02 li:nth-child(4n+4),.add_long li:nth-child(4n+4){ margin-right: 0;}
			.case_box .check02 li.on,.add_long li.on{ background-color: #1c63fa; color: #fff;}
			.case_box .btn{ position:relative; height: 50px; margin-top:15px;}
			.case_box .btn::after{ position:absolute; content: ""; left: 0; top: 0; right: 0; border-top: 1px #d4d4d4 solid; transform: scaleY(0.5);}
			.case_box .btn::before{ position:absolute; content: ""; left: 50%; top: 0; bottom: 0; border-right: 1px #d4d4d4 solid; transform: scaleX(0.5);}
			.case_box .btn button{ display:block; float: left; border: 0; width: 50%; text-align: center; font-size: 15px; color: #333; height: 50px; background-color: transparent; border-radius: 0;}
			.case_box .btn button.on{ color:#1c63fa;}
			
			.display-none { display:none !important; }
			
			@keyframes fadein{
				0%{opacity: 0;
					 }
				100%{
					opacity: 1;

				}
			}
			@-webkit-keyframes fadein{
					0%{opacity: 0;
					 }
				100%{
					opacity: 1;

				}
			}
			@-moz-keyframes fadein{
					0%{opacity: 0;
					 }
				100%{
					opacity: 1;

				}
			}
			@-o-keyframes fadein{
					0%{opacity: 0;
					 }
				100%{
					opacity: 1;

				}
			}
			@-ms-keyframes fadein{
					0%{opacity: 0;
					 }
				100%{
					opacity: 1;

				}
			}
		</style>
	</head>
	<body>
		<div id="filter" style="height:100%;">
			<div id="content">
				<div class="s_type" id="navlist">
					<a href="javascript:;" tapmode onclick="filter(this);" attr-type="1"><i><img src="../../image/img_42.png" alt="" /><span id="sendarea">--</span></i></a>
					<a href="javascript:;" tapmode onclick="filter(this);" attr-type="2"><i><img src="../../image/img_41.png" alt="" /><span id="destarea">--</span></i></a>
					<a href="javascript:;" tapmode onclick="filter(this);" attr-type="3"><i>筛选</i></a>
				</div>
				<div class="Area" id="arealist">
					<div class="block AreaLeft">
						<ul id="provincelist">
							
						</ul>
						<script id="provincelist_template" type="text/template">
						{{ for (var i = 0, len = it.length; i < len; i++) { }}
						<li class="leftarea" tapmode onclick="selProvince(this,{{=i}});" data-id="{{=it[i].id}}">{{=it[i].name}}</li>
						{{ } }}
					</script>
					</div>
					<div class="block AreaCenter">
						<ul id="citylist">
							
						</ul>
						<script id="citylist_template" type="text/template">
						{{ for (var i = 0, len = it.length; i < len; i++) { }}
						<li class="centerarea" tapmode onclick="selCity(this,{{=i}});" data-id="{{=it[i].id}}">{{=it[i].name}}</li>
						{{ } }}
						</script>
					</div>
					<div class="block AreaRight">
						<ul id="xianlist">
							
						</ul>
						<script id="arealist_template" type="text/template">
						{{ for (var i = 0, len = it.length; i < len; i++) { }}
						<li class="rightarea" tapmode onclick="selArea(this);" data-id="{{=it[i].id}}">{{=it[i].name}}</li>
						{{ } }}
						</script>
					</div>
				</div>
				<div class="case_box" id="filtersearch">
					<div class="top">
						<b>装卸类型</b>
						<ul class="check clearfix" id="transporttypelist">
						</ul>
						<script id="transporttypelist_template" type="text/template">
						<li tapmode data-transporttype="0" onclick="selTransporttypetype(this);"><span{{ if (transporttype == 0) { }} class="on"{{ } }}>不限类型</span></li>
						{{ for (var i = 0, len = it.length; i < len; i++) { }}
						<li tapmode data-transporttype="{{=it[i].id}}" onclick="selTransporttypetype(this);"><span{{ if (it[i].id == transporttype) { }} class="on"{{ } }}>{{=it[i].transporttypeName}}</span></li>
						{{ } }}
						</script>
						<b>装卸时间</b>
						<ul class="check check01 clearfix" id="timetypelist">
							
						</ul>
						<script id="timetypelist_template" type="text/template">
						<li tapmode data-loadingtime="0" onclick="selTimetype(this);"><span{{ if (loadingtime == 0) { }} class="on"{{ } }}>不限</span></li>
						<li tapmode data-loadingtime="1" onclick="selTimetype(this);"><span{{ if (loadingtime == 1) { }} class="on"{{ } }}>今天</span></li>
						<li tapmode data-loadingtime="2" onclick="selTimetype(this);"><span{{ if (loadingtime == 2) { }} class="on"{{ } }}>明天</span></li>
						<li tapmode data-loadingtime="3" onclick="selTimetype(this);"><span{{ if (loadingtime == 3) { }} class="on"{{ } }}>明天以后</span></li>
						</script>
						<b>车长（可多选）</b>
						<ul class="check02 clearfix" id="carlenlist">
						</ul>
						<script id="carlenlist_template" type="text/template">
						<li tapmode data-carlen="0" onclick="selCarlen(this,1);" {{ if (checkcarlen(carlen,0)) { }}class="on"{{ } }}>不限</li>
						{{ for (var i = 0, len = it.length; i < len; i++) { }}		
						<li tapmode data-carlen="{{=it[i].id}}" {{ if (checkcarlen(carlen,it[i].id)) { }}class="on"{{ } }} onclick="selCarlen(this,0);">{{=it[i].carlenName}}</li>
						{{ } }}
						</script>
						<b>车型（可多选）</b>
						<ul class="check02 clearfix" id="cartypelist">
						</ul>
						<script id="cartypelist_template" type="text/template">
						<li tapmode data-cartype="0" onclick="selCartype(this,1);" {{ if (checkcarlen(cartype,0)) { }}class="on"{{ } }}>不限</li>
						{{ for (var i = 0, len = it.length; i < len; i++) { }}
						<li tapmode data-cartype="{{=it[i].id}}" {{ if (checkcarlen(cartype,it[i].id)) { }}class="on"{{ } }} onclick="selCartype(this,0);">{{=it[i].cartypeName}}</li>
						{{ } }}
						</script>
						<ul class="btn">
							<button tapmode="btnpress" onclick="resetTag();">重置</button>
							<button tapmode="btnpress" onclick="searchBytag();" class="on">确定</button>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js" ></script>
	<script type="text/javascript" src="../../script/app.js" ></script>
	<script type="text/javascript" src="../../script/doT.js"></script>
	<script type="text/javascript">
		var curFiltertype;
		var provinceJson, cityJson, areaJson;
		var sendprovinceId = '', sendcityId = '', sendareaId = '';
		var destprovinceId = '', destcityId = '', destareaId = '';
		var sendcity = '',destarea = '';
				
		var transporttype = 0; //用车类型
		var loadingtime = 0; //0不限
		var cartype = [];
		var carlen = []; //车长
		var fromfrm;
		apiready = function() {
			api.parseTapmode();
			fromfrm = api.pageParam.fromfrm;
			api.getPrefs({
				key: 'filterset'
			}, function(ret, err) {
				if (ret.value) {
					var filtersetinfo = JSON.parse(ret.value);
					sendprovinceId = filtersetinfo.sendprovinceId;
					sendcityId = filtersetinfo.sendcityId;
					sendareaId = filtersetinfo.sendareaId;
					destprovinceId = filtersetinfo.destprovinceId;
					destcityId = filtersetinfo.destcityId;
					destareaId = filtersetinfo.destareaId;
					//sendcity = filtersetinfo.sendcity;
					destarea = filtersetinfo.destarea;
					transporttype = filtersetinfo.transporttype;
					loadingtime = filtersetinfo.loadingtime;
					cartype = filtersetinfo.cartype;
					carlen = filtersetinfo.carlen;
				}
				
			});
			//点击空白处移除Frame
			var myDiv = document.getElementById("filter");
			myDiv.addEventListener("touchstart",function(){
				//api.setFrameAttr({
					//name: 'filter_frm',
					//hidden: true
				//});
				api.execScript({
					name: fromfrm,
					script: 'restoreLi();'
				});
				api.closeFrame({
					name: api.frameName
				});
			});
			var myDiv1 = document.getElementById("content");
			myDiv1.addEventListener("touchstart",function(event){
				event=event||window.event;
				event.stopPropagation();
			});
			sendcity = api.pageParam.sendarea;
			destarea = api.pageParam.destarea;
			$api.text($api.byId('sendarea'),api.pageParam.sendarea);
			$api.text($api.byId('destarea'),api.pageParam.destarea);
			
			var filtertype = api.pageParam.filtertype;
			curFiltertype = filtertype;
			var liList = document.getElementById("navlist").children;
			$api.addCls(liList[filtertype-1],'on');

			getJsonFromAPI(filtertype);
			
			//监听筛选类型变化
			api.addEventListener({
				name: 'changeFiltertype'
			}, function(ret, err) {
				//alert(ret.value.filtertype);
				curFiltertype = ret.value.filtertype;
				getJsonFromAPI(ret.value.filtertype);
			});
		}
		function checkcarlen(obj,id)
		{
			var res = false;
			id = parseInt(id);
			for(var item in obj)
			{
				if(parseInt(obj[item]) == id)
				{
					res = true;
					break;
				}
			}
			if(id == 0){
				
			}
			if(obj.length == 0 && id==0) {
				res = true;
			}
			return res;
		}
		function resetTag() {
			//重置
			var liList = document.getElementById("transporttypelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i].firstElementChild, 'on');
			}
			$api.addCls(liList[0].firstElementChild, 'on');
			liList = document.getElementById("timetypelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i].firstElementChild, 'on');
			}
			$api.addCls(liList[0].firstElementChild, 'on');
			liList = document.getElementById("carlenlist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i], 'on');
			}
			$api.addCls(liList[0], 'on');
			liList = document.getElementById("cartypelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i], 'on');
			}
			$api.addCls(liList[0], 'on');
			var filtersetjson = {
				sendprovinceId: sendprovinceId,
				sendcityId: sendcityId,
				sendareaId: sendareaId,
				destprovinceId: destprovinceId,
				destcityId: destcityId,
				destareaId: destareaId,
				sendcity: sendcity,
				destarea: destarea,
				transporttype: 0,
				loadingtime: 0,
				cartype: [],
				carlen: [],
				keyword: '',
				keywordtype: ''
			};
			api.setPrefs({
				key: 'filterset',
				value: filtersetjson
			}, function(ret, err) {
			});
		}
		function searchBytag() {
			//按条件筛选
			carlen = [];
			var liList = document.getElementById("carlenlist").children;
			for (var i = 0; i < liList.length; i++) {
				if($api.hasCls(liList[i], 'on'))
				{
					var curcarlen = parseInt($api.attr(liList[i],'data-carlen'));
					carlen.push(curcarlen);
				}
			}
			cartype = [];
			var liList1 = document.getElementById("cartypelist").children;
			for (var i = 0; i < liList1.length; i++) {
				if($api.hasCls(liList1[i], 'on'))
				{
					var curcartype = parseInt($api.attr(liList1[i],'data-cartype'));
					cartype.push(curcartype);
				}
			}
			var filtersetjson = {
				sendprovinceId: sendprovinceId,
				sendcityId: sendcityId,
				sendareaId: sendareaId,
				destprovinceId: destprovinceId,
				destcityId: destcityId,
				destareaId: destareaId,
				sendcity: sendcity,
				destarea: destarea,
				transporttype: transporttype,
				loadingtime: loadingtime,
				cartype: cartype,
				carlen: carlen,
				keyword: '',
				keywordtype: ''
			};
			api.setPrefs({
				key: 'filterset',
				value: filtersetjson
			}, function(ret, err) {
				var params = {
					where: filtersetjson,
					page: 1
				};
				var jsonstr = $api.jsonToStr(params);
				console.log(jsonstr);
				api.execScript({
					name: fromfrm,
					script: 'getFilterJsonFromAPI(\'' + $api.jsonToStr(params) + '\');'
				});
				
			});
		}
		function filter(obj) {
			var filtertype = $api.attr(obj,'attr-type');
			var liList = document.getElementById("navlist").children;
			for (var i = 0; i < liList.length; i++) {
				var curfiltertype = $api.attr(liList[i],'attr-type');
				if(curfiltertype != filtertype)
				{
					$api.removeCls(liList[i], 'on')
				}
			}
			$api.toggleCls(obj, 'on');
			curFiltertype = filtertype;
			getJsonFromAPI(filtertype);
		}
		function selTransporttypetype(obj) {
			document.activeElement.blur();
			transporttype = $api.attr(obj,'data-transporttype');
			var liList = document.getElementById("transporttypelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i].firstElementChild, 'on')
			}
			$api.toggleCls(obj.firstElementChild,'on');
		}
		function selTimetype(obj) {
			document.activeElement.blur();
			loadingtime = $api.attr(obj,'data-loadingtime');
			var liList = document.getElementById("timetypelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i].firstElementChild, 'on')
			}
			$api.toggleCls(obj.firstElementChild,'on');
		}
		function selCartype(obj,id) {
			document.activeElement.blur();
			if(id == 1)
			{
				var liList = document.getElementById("cartypelist").children;
				for (var i = 0; i < liList.length; i++) {
					$api.removeCls(liList[i], 'on')
				}
			}
			else
			{
				var liList = document.getElementById("cartypelist").children;
				$api.removeCls(liList[0], 'on')
			}
			$api.toggleCls(obj,'on');
		}
		function selCarlen(obj,id) {
			document.activeElement.blur();
			if(id == 1)
			{
				var liList = document.getElementById("carlenlist").children;
				for (var i = 0; i < liList.length; i++) {
					$api.removeCls(liList[i], 'on')
				}
				$api.val($api.byId('carlenother'),'');
			}
			else
			{
				var liList = document.getElementById("carlenlist").children;
				$api.removeCls(liList[0], 'on')
			}
			$api.toggleCls(obj,'on');
		}
		function getJsonFromAPI(filtertype) {
			if(filtertype < 3)
			{
				$api.css($api.byId('filtersearch'),'display:none');
				$api.css($api.byId('arealist'),'display:block');
				api.readFile({
					path: 'widget://res/cityextra.json'
				}, function(ret, err) {
					if (ret.status) {
						var data = ret.data;
						provinceJson = $api.strToJson(data);
						if(filtertype == 2)
						{
							var ndata = {"name":"全国","id":"0","sub":[]};
							provinceJson.splice(0, 0, ndata); //首位插入全国
						}
						UpdateList('provincelist','provincelist_template',provinceJson);
						//cityJson = provinceJson[0].sub;
						cityJson = [];
						UpdateList('citylist','citylist_template',cityJson);
						
						//areaJson = cityJson[0].sub;
						areaJson = [];
						UpdateList('xianlist','arealist_template',areaJson);
					} else {
						//alert(err.msg);
					}
				});
			}
			else
			{
				if(filtertype == 3)
				{
					$api.css($api.byId('arealist'),'display:none');
					$api.css($api.byId('filtersearch'),'display:block');
					api.getPrefs({
						key: 'user_info'
					}, function(ret, err) {
						if (ret.value) {
							var userinfo = JSON.parse(ret.value);
							api.ajax({
								url: ApiUrl + '/v1/searchgoods',
								method: 'get',
								cache: false,
								timeout: 10,
								headers: {
									authorization: kAppKey+';'+userinfo.access_token+';'+userinfo.uid
								}
							}, function(ret, err) {
								if (ret) {
									console.log(JSON.stringify(ret));

									var transporttypelist = ret.transporttypelist;
									UpdateList('transporttypelist','transporttypelist_template',transporttypelist,false);
									
									UpdateList('timetypelist','timetypelist_template',[],true);
									var cartypelist = ret.cartypelist;
									UpdateList('cartypelist','cartypelist_template',cartypelist,true);
									
									var carlenlist = ret.carlenlist;
									UpdateList('carlenlist','carlenlist_template',carlenlist,true);
								} else {
									if(err.statusCode==402)
									{
										Relogin();
									}
									else
									{
										console.log(JSON.stringify(err));
										toast('网络异常');
									}
								}
							});
						}
					});
					
				}
			}
		}
		function selProvince(obj,index) {
			//选择省份
			var provinceId = $api.attr(obj,'data-id');
			var provinceName = $api.text(obj);
			var liList = document.getElementById("provincelist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i], 'on')
			}
			$api.addCls(obj,'on');
			if(provinceId == 0)
			{
				if(curFiltertype == 1)
				{
					sendprovinceId = '';
					sendcityId = '';
					sendareaId = '';
					sendcity = provinceName;
					$api.text($api.byId('sendarea'),provinceName);
				}
				else
				{
					destprovinceId = '';
					destcityId = '';
					destareaId = '';
					destarea = provinceName;
					$api.text($api.byId('destarea'),provinceName);
				}
				var filtersetjson = {
					sendprovinceId: sendprovinceId,
					sendcityId: sendcityId,
					sendareaId: sendareaId,
					destprovinceId: destprovinceId,
					destcityId: destcityId,
					destareaId: destareaId,
					sendcity: sendcity,
					destarea: destarea,
					transporttype: transporttype,
					loadingtime: loadingtime,
					cartype: cartype,
					carlen: carlen,
					keyword: '',
					keywordtype: ''
					
				};
				api.setPrefs({
					key: 'filterset',
					value: filtersetjson
				}, function(ret, err) {
					var params = {
						where: filtersetjson,
						page: 1
					};
					var jsonstr = $api.jsonToStr(params);
					
					api.execScript({
						name: fromfrm,
						script: 'getFilterJsonFromAPI(\'' + $api.jsonToStr(params) + '\');'
					});
					
				});
			}
			else
			{
				if(curFiltertype == 1)
				{
					sendprovinceId = provinceId;
					sendcity = provinceName;
				}
				else
				{
					destprovinceId = provinceId;
					destarea = provinceName;
				}
				cityJson = provinceJson[index].sub;
				UpdateList('citylist','citylist_template',cityJson);
			}
		}
		function selCity(obj,index) {
			//选择城市
			var cityId = $api.attr(obj,'data-id');
			var cityName = $api.text(obj);
			var liList = document.getElementById("citylist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i], 'on')
			}
			$api.addCls(obj,'on');
			if(cityId == 0)
			{
				if(curFiltertype == 1)
				{
					sendcityId = '';
					sendareaId = '';
					//sendcity = cityName;
					$api.text($api.byId('sendarea'),cityName);
				}
				else
				{
					destcityId = '';
					destareaId = '';
					//destarea = cityName;
					$api.text($api.byId('destarea'),cityName);
				}
				var filtersetjson = {
					sendprovinceId: sendprovinceId,
					sendcityId: sendcityId,
					sendareaId: sendareaId,
					destprovinceId: destprovinceId,
					destcityId: destcityId,
					destareaId: destareaId,
					sendcity: sendcity,
					destarea: destarea,
					transporttype: transporttype,
					loadingtime: loadingtime,
					cartype: cartype,
					carlen: carlen,
					keyword: '',
					keywordtype: ''
				};
				api.setPrefs({
					key: 'filterset',
					value: filtersetjson
				}, function(ret, err) {
					var params = {
						where: filtersetjson,
						page: 1
					};
					var jsonstr = $api.jsonToStr(params);
					
					api.execScript({
						name: fromfrm,
						script: 'getFilterJsonFromAPI(\'' + $api.jsonToStr(params) + '\');'
					});
					
				});
			}
			else
			{
				if(curFiltertype == 1)
				{
					sendcityId = cityId;
					sendcity = cityName;
				}
				else
				{
					destcityId = cityId;
					destarea = cityName;
				}
				areaJson = cityJson[index].sub;
				UpdateList('xianlist','arealist_template',areaJson);
			}
		}
		function selArea(obj) {
			var areaId = $api.attr(obj,'data-id');
			var areaName = $api.text(obj);
			var liList = document.getElementById("xianlist").children;
			for (var i = 0; i < liList.length; i++) {
				$api.removeCls(liList[i], 'on')
			}
			$api.addCls(obj,'on');
			if(areaId == 0)
			{
				if(curFiltertype == 1)
				{
					sendareaId = '';
					//sendcity = areaName;
					$api.text($api.byId('sendarea'),areaName);
				}
				else
				{
					destareaId = '';
					//destarea = areaName;
					$api.text($api.byId('destarea'),areaName);
				}
				
			}
			else
			{
				if(curFiltertype == 1)
				{
					sendareaId = areaId;
					sendcity = areaName;
					$api.text($api.byId('sendarea'),areaName);
				}
				else
				{
					destareaId = areaId;
					destarea = areaName;
					$api.text($api.byId('destarea'),areaName);
				}
			}
			var filtersetjson = {
				sendprovinceId: sendprovinceId,
				sendcityId: sendcityId,
				sendareaId: sendareaId,
				destprovinceId: destprovinceId,
				destcityId: destcityId,
				destareaId: destareaId,
				sendcity: sendcity,
				destarea: destarea,
				transporttype: transporttype,
				loadingtime: loadingtime,
				cartype: cartype,
				carlen: carlen,
				keyword: '',
				keywordtype: ''
			};
			api.setPrefs({
				key: 'filterset',
				value: filtersetjson
			}, function(ret, err) {
				var params = {
					where: filtersetjson,
					page: 1
				};
				var jsonstr = $api.jsonToStr(params);
				
				api.execScript({
					name: fromfrm,
					script: 'getFilterJsonFromAPI(\'' + $api.jsonToStr(params) + '\');'
				});
				
			});
			
		}
		//渲染数据
		function UpdateList(domId,templateId,jsondata) {
			
			var act_content = $api.byId(domId);
			//act_content.innerHTML = '';
			$api.html(act_content,'');
			setTimeout(function() {
				var tempFn = doT.template($api.byId(templateId).innerHTML);
				var resultText = tempFn(jsondata);
				//act_content.innerHTML = resultText;
				$api.html(act_content, resultText);
				api.parseTapmode();
			}, 0);
			
		}
	</script>
</html>